<html>
<head><meta charset="utf-8"><title>design meeting 2020-03-06 · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html">design meeting 2020-03-06</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="189640214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189640214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189640214">(Mar 03 2020 at 22:12)</a>:</h4>
<p>Hey <span class="user-group-mention" data-user-group-id="897">@T-compiler/meeting</span> -- the next design meeting (2020-03-06) will be discussing <a href="https://github.com/rust-lang/compiler-team/issues/234" target="_blank" title="https://github.com/rust-lang/compiler-team/issues/234">compiler-team#234</a>, a proposal for a design for a shared library that defines types and can be used by rustc/chalk/rust-analyzer. There is now a <a href="https://hackmd.io/roRq0qHMQ6CyRJxj_FsPSQ" target="_blank" title="https://hackmd.io/roRq0qHMQ6CyRJxj_FsPSQ">write-up available</a> sketching the ideas and also trying to outline what the meeting should discuss and what is out of scope. Thoughts and feedback welcome!</p>



<a name="189644251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189644251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189644251">(Mar 03 2020 at 23:06)</a>:</h4>
<p>fyi, I will mostly not be here this time but will try to leave some thoughts before then</p>



<a name="189654562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189654562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189654562">(Mar 04 2020 at 02:13)</a>:</h4>
<p>(I also will not be able to attend; I hope to provide feedback  on the hackmd write-up before the meeting itself.)</p>



<a name="189746408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189746408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189746408">(Mar 04 2020 at 23:18)</a>:</h4>
<p>The proposal looks good to me. I would like to note that the complexity feels pretty small, in particular the changes to rustc seem loosely good even if they don't end up going anywhere :)</p>
<p>I agree with the approach to start out with the in rust-lang/rust crate, too.</p>



<a name="189884683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189884683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189884683">(Mar 06 2020 at 11:50)</a>:</h4>
<p><span aria-label="exclamation" class="emoji emoji-2757" role="img" title="exclamation">:exclamation:</span>  One (hopefully quick) agenda item to add: We have two independent fixes for beta-regression <a href="https://github.com/rust-lang/rust/issues/69191" target="_blank" title="https://github.com/rust-lang/rust/issues/69191">#69191</a>. The first PR is <a href="https://github.com/rust-lang/rust/issues/69753" target="_blank" title="https://github.com/rust-lang/rust/issues/69753">#69753</a>. The second is  <a href="https://github.com/rust-lang/rust/issues/69768" target="_blank" title="https://github.com/rust-lang/rust/issues/69768">#69768</a>. The question is: What to do with each PR w.r.t nightly and beta branches, given that beta is imminently going to be promoted to stable.</p>



<a name="189884704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189884704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189884704">(Mar 06 2020 at 11:50)</a>:</h4>
<p>(My personal suggestion is to land both PR's on nightly, and then backport solely PR <a href="https://github.com/rust-lang/rust/issues/69753" target="_blank" title="https://github.com/rust-lang/rust/issues/69753">#69753</a>.)</p>



<a name="189884856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189884856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189884856">(Mar 06 2020 at 11:52)</a>:</h4>
<p>((related  discussion over on the <a href="#narrow/stream/131828-t-compiler/topic/ICE.20access.20field.20of.20uninhabited.20enum.20.2369191/near/189882483" title="#narrow/stream/131828-t-compiler/topic/ICE.20access.20field.20of.20uninhabited.20enum.20.2369191/near/189882483">zulip topic for the beta regression itself</a>)</p>



<a name="189885749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189885749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189885749">(Mar 06 2020 at 12:07)</a>:</h4>
<p>well, we can just land <a href="https://github.com/rust-lang/rust/issues/69753" target="_blank" title="https://github.com/rust-lang/rust/issues/69753">#69753</a> on beta and <a href="https://github.com/rust-lang/rust/issues/69768" target="_blank" title="https://github.com/rust-lang/rust/issues/69768">#69768</a> on nightly, as <a href="https://github.com/rust-lang/rust/issues/69768" target="_blank" title="https://github.com/rust-lang/rust/issues/69768">#69768</a> would revert <a href="https://github.com/rust-lang/rust/issues/69753" target="_blank" title="https://github.com/rust-lang/rust/issues/69753">#69753</a> if it were already merged</p>



<a name="189885823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189885823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189885823">(Mar 06 2020 at 12:08)</a>:</h4>
<p>funnily enough I don't think they would conflict</p>



<a name="189900374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189900374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189900374">(Mar 06 2020 at 14:54)</a>:</h4>
<p>Hello <span class="user-group-mention" data-user-group-id="897">@T-compiler/meeting</span>! Design meeting starts in ~6 minutes. As I <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189640214" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189640214">wrote at the start of this topic</a>:</p>
<blockquote>
<p>The next design meeting (2020-03-06) will be discussing <a href="https://github.com/rust-lang/compiler-team/issues/234" target="_blank" title="https://github.com/rust-lang/compiler-team/issues/234">compiler-team#234</a>, a proposal for a design for a shared library that defines types and can be used by rustc/chalk/rust-analyzer. There is now a <a href="https://hackmd.io/roRq0qHMQ6CyRJxj_FsPSQ" target="_blank" title="https://hackmd.io/roRq0qHMQ6CyRJxj_FsPSQ">write-up available</a> sketching the ideas and also trying to outline what the meeting should discuss and what is out of scope. Thoughts and feedback welcome!</p>
</blockquote>



<a name="189900945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189900945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189900945">(Mar 06 2020 at 15:00)</a>:</h4>
<p>Hello <span class="user-group-mention" data-user-group-id="897">@T-compiler/meeting</span> -- meeting starting <strong>now</strong>! Please add <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span> emoji to show you're here. We'll kick off with 5 minutes of...</p>
<h1>Announcements</h1>



<a name="189901198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189901198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189901198">(Mar 06 2020 at 15:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116083">pnkfelix</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189884683" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189884683">said</a>:</p>
<blockquote>
<p><span aria-label="exclamation" class="emoji emoji-2757" role="img" title="exclamation">:exclamation:</span>  One (hopefully quick) agenda item to add: We have two independent fixes for beta-regression <a href="https://github.com/rust-lang/rust/issues/69191" target="_blank" title="https://github.com/rust-lang/rust/issues/69191">#69191</a>. The first PR is <a href="https://github.com/rust-lang/rust/issues/69753" target="_blank" title="https://github.com/rust-lang/rust/issues/69753">#69753</a>. The second is  <a href="https://github.com/rust-lang/rust/issues/69768" target="_blank" title="https://github.com/rust-lang/rust/issues/69768">#69768</a>. The question is: What to do with each PR w.r.t nightly and beta branches, given that beta is imminently going to be promoted to stable.</p>
</blockquote>



<a name="189901210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189901210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189901210">(Mar 06 2020 at 15:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116083">pnkfelix</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189884704" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189884704">said</a>:</p>
<blockquote>
<p>(My personal suggestion is to land both PR's on nightly, and then backport solely PR <a href="https://github.com/rust-lang/rust/issues/69753" target="_blank" title="https://github.com/rust-lang/rust/issues/69753">#69753</a>.)</p>
</blockquote>



<a name="189901386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189901386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189901386">(Mar 06 2020 at 15:05)</a>:</h4>
<p>I am just seeing this now, but I see that <span class="user-mention" data-user-id="116083">@pnkfelix</span> is making the suggestion because <a href="https://github.com/rust-lang/rust/issues/69753" target="_blank" title="https://github.com/rust-lang/rust/issues/69753">#69753</a> is a very narrow fix and whatever we backport will become insta-stable. Seems reasonable to me. Does anyone object to just backporting <a href="https://github.com/rust-lang/rust/issues/69753" target="_blank" title="https://github.com/rust-lang/rust/issues/69753">#69753</a>?</p>



<a name="189901424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189901424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189901424">(Mar 06 2020 at 15:05)</a>:</h4>
<p>no objection, actually very much in favour of doing it this way</p>



<a name="189901528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189901528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189901528">(Mar 06 2020 at 15:07)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="w">    </span><span class="n">_Variant</span><span class="p">(</span><span class="n">Void</span><span class="p">),</span><span class="w"></span>
<span class="w">    </span><span class="n">_Warriont</span><span class="p">(</span><span class="n">Void</span><span class="p">),</span><span class="w"></span>
<span class="w">    </span><span class="n">_Worrynot</span><span class="p">(</span><span class="n">Void</span><span class="p">),</span><span class="w"></span>
</pre></div>


<p>Btw... Something about this makes me smile <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="189901596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189901596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189901596">(Mar 06 2020 at 15:08)</a>:</h4>
<p>OK, any final announcements?</p>



<a name="189901762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189901762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189901762">(Mar 06 2020 at 15:10)</a>:</h4>
<p>OK, let's kick it off then</p>



<a name="189901851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189901851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189901851">(Mar 06 2020 at 15:10)</a>:</h4>
<p>So I laid out two goals for the meeting:</p>
<ul>
<li>Discuss the “high-level plan” for the design</li>
<li>Discuss the roadmap and initial steps to work towards this goal</li>
</ul>



<a name="189901918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189901918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189901918">(Mar 06 2020 at 15:11)</a>:</h4>
<p>Let's start in on the first item? I'm going to just give periodic timing reminders, I'd like to leave at least 20 minutes for the final item, so I guess that means ~20 minutes for first, ~20 minutes for second, and 10 minutes to talk about random things :)</p>



<a name="189901928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189901928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189901928">(Mar 06 2020 at 15:11)</a>:</h4>
<p>but let's see</p>



<a name="189902031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902031">(Mar 06 2020 at 15:12)</a>:</h4>
<p>So yeah the big picture here is the idea of extracting out some kind of "shared library" that will represent Rust's types. The goal is for this library to be usable directly by rustc, rust-analyzer, and chalk, so that everyone can share a representation of Rust's types.</p>



<a name="189902087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902087">(Mar 06 2020 at 15:13)</a>:</h4>
<p>One of the tricky bits is that the different consumers have somewhat different requirements -- rustc uses interning, rust-analyzer doesn't (and probably shouldn't), and chalk wants to work with both (though it doesn't use interning in its tests)</p>



<a name="189902143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902143">(Mar 06 2020 at 15:13)</a>:</h4>
<p>This leads to the <a href="https://hackmd.io/roRq0qHMQ6CyRJxj_FsPSQ#Proposed-end-goal-the-basic-pattern-for-representing-types" target="_blank" title="https://hackmd.io/roRq0qHMQ6CyRJxj_FsPSQ#Proposed-end-goal-the-basic-pattern-for-representing-types">proposed pattern</a> for representing types, where the actual <em>representation</em> of a type is made generic, and we just define methods for getting at a <code>TyData</code> enum that contains the variants (and some flags)</p>



<a name="189902201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902201">(Mar 06 2020 at 15:14)</a>:</h4>
<p>(Side note: <span class="user-mention" data-user-id="232957">@Jack Huey</span> , we should add "add flags" to the list of chalk adaptation steps)</p>



<a name="189902293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902293">(Mar 06 2020 at 15:15)</a>:</h4>
<p>I won't copy and paste the whole doc here, I'm presuming most folks looked it over or are doing a bit of that now</p>



<a name="189902330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902330">(Mar 06 2020 at 15:15)</a>:</h4>
<p>oh and cc <span class="user-group-mention" data-user-group-id="1060">@WG-rls2.0</span> in case those folks aren't on the meeting group</p>



<a name="189902341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902341">(Mar 06 2020 at 15:15)</a>:</h4>
<p>anway basically the way to represent types is just</p>
<div class="codehilite"><pre><span></span><span class="k">pub</span><span class="w"> </span><span class="k">struct</span> <span class="nc">Ty</span><span class="o">&lt;</span><span class="n">I</span>: <span class="nc">Interner</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">interned</span>: <span class="nc">I</span>::<span class="n">InternedType</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="189902408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902408">(Mar 06 2020 at 15:16)</a>:</h4>
<p>but you can use <code>ty.data(interner)</code> to get access to the type data:</p>
<div class="codehilite"><pre><span></span><span class="k">enum</span> <span class="nc">TyData</span><span class="o">&lt;</span><span class="n">I</span>: <span class="nc">Interner</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">Apply</span><span class="p">(</span><span class="n">ApplicationTy</span><span class="o">&lt;</span><span class="n">I</span><span class="o">&gt;</span><span class="p">),</span><span class="w"></span>
<span class="w">    </span><span class="n">Placeholder</span><span class="p">(</span><span class="n">PlaceholderIndex</span><span class="p">),</span><span class="w"></span>
<span class="w">    </span><span class="n">Dyn</span><span class="p">(</span><span class="n">DynTy</span><span class="o">&lt;</span><span class="n">I</span><span class="o">&gt;</span><span class="p">),</span><span class="w"></span>
<span class="w">    </span><span class="n">Alias</span><span class="p">(</span><span class="n">AliasTy</span><span class="o">&lt;</span><span class="n">I</span><span class="o">&gt;</span><span class="p">),</span><span class="w"></span>
<span class="w">    </span><span class="n">Function</span><span class="p">(</span><span class="nb">Fn</span><span class="o">&lt;</span><span class="n">I</span><span class="o">&gt;</span><span class="p">),</span><span class="w"></span>
<span class="w">    </span><span class="n">BoundVar</span><span class="p">(</span><span class="kt">usize</span><span class="p">),</span><span class="w"></span>
<span class="w">    </span><span class="n">InferenceVar</span><span class="p">(</span><span class="n">InferenceVar</span><span class="p">),</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="189902462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902462">(Mar 06 2020 at 15:16)</a>:</h4>
<p>(In Chalk today, it's <code>ty.data()</code>, but we're adding an <code>interner</code> argument to support different kinds of interning; e.g., rust-analyzer presently uses a form of interning where types are represented as an integer, and that is integrated into the incremental system to allow recycling integers when things change etc)</p>



<a name="189902464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902464">(Mar 06 2020 at 15:16)</a>:</h4>
<p>Pros with the proposed design:</p>
<ul>
<li>It will improve interner independence, allowing us to be generic over <code>I: TyInterner</code> in logic code, not just data definitions, although in practice you need <code>tcx</code> to get interesting info via queries.</li>
</ul>
<p>Cons with the proposed design:</p>
<ul>
<li>Some additional noise, <code>.kind</code> vs <code>.data(tcx)</code></li>
<li><code>tcx</code> has to be passed to more places.</li>
<li>More monomorphization needed, regressing <code>./x.py</code> compile times?</li>
<li>We give up the ability to do deep pattern matching on <code>TyS</code></li>
</ul>



<a name="189902483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902483">(Mar 06 2020 at 15:17)</a>:</h4>
<p>bikeshed: <code>interner[ty].data()</code> might flow a bit better, but also <code>interner</code> could be <code>cx</code> which would make it <code>cx[ty]</code> vs <code>ty.data(cx)</code></p>



<a name="189902501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902501">(Mar 06 2020 at 15:17)</a>:</h4>
<p>also I assume <code>kind</code> vs <code>data</code> is another bikeshed</p>



<a name="189902611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902611">(Mar 06 2020 at 15:18)</a>:</h4>
<p>yes, I'd like to avoid the bikesheds for now, but let's note them down</p>



<a name="189902627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902627">(Mar 06 2020 at 15:18)</a>:</h4>
<p>(<code>ty.kind(cx)</code> feels more obvious)</p>



<a name="189902651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902651">(Mar 06 2020 at 15:18)</a>:</h4>
<p>yeah if you want a method there I kind of agree</p>



<a name="189902656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902656">(Mar 06 2020 at 15:18)</a>:</h4>
<p><code>kind</code> of course overlaps with other jargon, but  don't claim a strong opinion</p>



<a name="189902673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902673">(Mar 06 2020 at 15:18)</a>:</h4>
<p>I'm interested more in two other things <span class="user-mention" data-user-id="126931">@centril</span> noted</p>



<a name="189902678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902678">(Mar 06 2020 at 15:18)</a>:</h4>
<blockquote>
<p>kind of course overlaps with other jargon, but don't claim a strong opinion</p>
</blockquote>
<p>(As in higher <em>kinded</em> types?)</p>



<a name="189902688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902688">(Mar 06 2020 at 15:19)</a>:</h4>
<p>or "parameter kinds", etc</p>



<a name="189902700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902700">(Mar 06 2020 at 15:19)</a>:</h4>
<p>e.g., lifetime, type, const</p>



<a name="189902733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902733">(Mar 06 2020 at 15:19)</a>:</h4>
<p>that's the same notion of "kind" I'm pretty sure :P</p>



<a name="189902746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902746">(Mar 06 2020 at 15:19)</a>:</h4>
<p>(yes, just saying that it's relevant even if we never add HKT)</p>



<a name="189902753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902753">(Mar 06 2020 at 15:19)</a>:</h4>
<p>but maybe I should leave before I get out-theorized</p>



<a name="189902761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902761">(Mar 06 2020 at 15:19)</a>:</h4>
<p>I like abstracting more over the concrete representation of types so alternative representations could be more easily tried for performance reasons.</p>



<a name="189902822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902822">(Mar 06 2020 at 15:20)</a>:</h4>
<p>Anyhow, let's cut the bikeshed short <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="189902830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902830">(Mar 06 2020 at 15:20)</a>:</h4>
<p>one of the things I wanted to point out is that you can use the generic here in interesting ways to make code a bit more generic, or enforce separations</p>



<a name="189902837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902837">(Mar 06 2020 at 15:20)</a>:</h4>
<blockquote>
<p>More monomorphization needed</p>
</blockquote>
<p>Yeah, this is what I am worried about a lot. We hit repeated re-monomophizations <strong>a lot</strong> in rust-analyzer. Somehow forcing <code>-Z share_generics</code> for a specific  crate would be great</p>



<a name="189902873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902873">(Mar 06 2020 at 15:20)</a>:</h4>
<p>well, ok, let's turn to that :)</p>



<a name="189902897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902897">(Mar 06 2020 at 15:21)</a>:</h4>
<p>so, it's certainly true that in <em>rustc</em> you will only ever use one value for the <code>Interner</code> type</p>



<a name="189902911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902911">(Mar 06 2020 at 15:21)</a>:</h4>
<p>I'm somewhat unhappy about the loss of pattern matching personally, given that I very recently took advantage of it to make code read nicer</p>



<a name="189902975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189902975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189902975">(Mar 06 2020 at 15:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189902897" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189902897">said</a>:</p>
<blockquote>
<p>so, it's certainly true that in <em>rustc</em> you will only ever use one value for the <code>Interner</code> type</p>
</blockquote>
<p>and to the extent that we mostly extract <em>definitions</em>, there isn't much code to monomorphize, but I do expect to also extract things like the folder,</p>



<a name="189903019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903019">(Mar 06 2020 at 15:22)</a>:</h4>
<p>but then that code is generic <em>anyway</em></p>



<a name="189903020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903020">(Mar 06 2020 at 15:22)</a>:</h4>
<p>...but I'm sure I can learn to live with it <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="189903046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903046">(Mar 06 2020 at 15:22)</a>:</h4>
<p>in short, I'm not really sure what the effect on compilation times will be, but I see no fundamental reason for them to be worse,</p>



<a name="189903049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903049">(Mar 06 2020 at 15:22)</a>:</h4>
<p>okay so this might seem offtopic, but, does Chalk do anything for interning slices? i.e. like <code>ty::List&lt;T&gt;</code> in rustc</p>



<a name="189903060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903060">(Mar 06 2020 at 15:22)</a>:</h4>
<p>(it may be something we want to look at and improve)</p>



<a name="189903066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903066">(Mar 06 2020 at 15:22)</a>:</h4>
<p>there are also some potential <em>advantages</em> though</p>



<a name="189903076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903076">(Mar 06 2020 at 15:22)</a>:</h4>
<p>in that we you can write libraries that work with types but which don't depend on the details of rustc</p>



<a name="189903096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903096">(Mar 06 2020 at 15:22)</a>:</h4>
<p>which is of course part of the whole goal here</p>



<a name="189903124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903124">(Mar 06 2020 at 15:23)</a>:</h4>
<p>i.e., we can get the point where modifying parts of rustc <em>doesn't</em> mean rebuilding the type checker, etc</p>



<a name="189903132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903132">(Mar 06 2020 at 15:23)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189903049" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189903049">said</a>:</p>
<blockquote>
<p>okay so this might seem offtopic, but, does Chalk do anything for interning slices? i.e. like <code>ty::List&lt;T&gt;</code> in rustc</p>
</blockquote>
<p>yes</p>



<a name="189903141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903141">(Mar 06 2020 at 15:23)</a>:</h4>
<p>I simplified things but</p>



<a name="189903142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903142">(Mar 06 2020 at 15:23)</a>:</h4>
<p>because I realized recently that <code>ty::List&lt;T&gt;</code>'s design could easily accomodate tracking flags even for<code>T</code>s that might not have use for them (or I guess the flags could be an associated type of <code>T</code>)</p>



<a name="189903161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903161">(Mar 06 2020 at 15:23)</a>:</h4>
<p>there are associated types for things like "list of parameters"</p>



<a name="189903165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903165">(Mar 06 2020 at 15:23)</a>:</h4>
<p>precisely for this reason</p>



<a name="189903167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903167">(Mar 06 2020 at 15:23)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  hmm... without access to <code>tcx</code> or <code>fcx</code> specifically, what sort of logic can you write without access to the methods on that?</p>



<a name="189903179"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903179" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903179">(Mar 06 2020 at 15:23)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> you take access to an <code>&amp;I</code> where <code>I: Interner</code></p>



<a name="189903231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903231">(Mar 06 2020 at 15:24)</a>:</h4>
<p>this is how all of chalk is written, for example</p>



<a name="189903233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903233">(Mar 06 2020 at 15:24)</a>:</h4>
<p>Yes, but <code>I: Interner</code> says very little</p>



<a name="189903250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903250">(Mar 06 2020 at 15:24)</a>:</h4>
<p>it says everything you need to access type data</p>



<a name="189903258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903258">(Mar 06 2020 at 15:24)</a>:</h4>
<p>but in chalk there is an add'l trait, <code>RustIrDatabase</code>, that gives access to select queries etc</p>



<a name="189903264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903264">(Mar 06 2020 at 15:24)</a>:</h4>
<p>Right; that's what I was after</p>



<a name="189903275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903275">(Mar 06 2020 at 15:25)</a>:</h4>
<p>(and which gives access to an interner)</p>



<a name="189903286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903286">(Mar 06 2020 at 15:25)</a>:</h4>
<p>yeah, so you basically declare your interface to the outside world</p>



<a name="189903306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903306">(Mar 06 2020 at 15:25)</a>:</h4>
<p>and then there is some crate that "knits" things together</p>



<a name="189903315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903315">(Mar 06 2020 at 15:25)</a>:</h4>
<p>So basically more tagless final, makes sense</p>



<a name="189903327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903327">(Mar 06 2020 at 15:25)</a>:</h4>
<p>I don't know what "tagless final" refers to =)</p>



<a name="189903375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903375">(Mar 06 2020 at 15:26)</a>:</h4>
<p>but it's a pretty standard pattern in many contexts</p>



<a name="189903380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903380">(Mar 06 2020 at 15:26)</a>:</h4>
<p>Is there something that requires interning in this design, or is it just named that since rustc uses interners?</p>



<a name="189903387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903387">(Mar 06 2020 at 15:26)</a>:</h4>
<p>the latter</p>



<a name="189903391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903391">(Mar 06 2020 at 15:26)</a>:</h4>
<p>we tried various names</p>



<a name="189903401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903401">(Mar 06 2020 at 15:26)</a>:</h4>
<p>but interner felt like the one that gave the most immediate intution</p>



<a name="189903408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903408">(Mar 06 2020 at 15:26)</a>:</h4>
<p>even if sometimes you aren't really <em>interning</em></p>



<a name="189903413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903413">(Mar 06 2020 at 15:26)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189903327" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189903327">said</a>:</p>
<blockquote>
<p>I don't know what "tagless final" refers to =)</p>
</blockquote>
<p>See e.g. <a href="http://okmij.org/ftp/tagless-final/index.html" target="_blank" title="http://okmij.org/ftp/tagless-final/index.html">http://okmij.org/ftp/tagless-final/index.html</a> and <a href="http://okmij.org/ftp/tagless-final/course/lecture.pdf" target="_blank" title="http://okmij.org/ftp/tagless-final/course/lecture.pdf">http://okmij.org/ftp/tagless-final/course/lecture.pdf</a></p>



<a name="189903485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903485">(Mar 06 2020 at 15:27)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189903142" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189903142">said</a>:</p>
<blockquote>
<p>because I realized recently that <code>ty::List&lt;T&gt;</code>'s design could easily accomodate tracking flags even for<code>T</code>s that might not have use for them (or I guess the flags could be an associated type of <code>T</code>)</p>
</blockquote>
<p>I hope this is a significant improvement for certain kinds of workloads, that currently have to do a linear search across <code>Substs</code>, or worse, across all <code>Substs</code> embedded in <code>[Predicate]</code> (e.g. <code>.has_...()</code> methods on <code>ParamEnv</code>)</p>
<p>but I don't know how soon I'll get to it or how long it would take to implement</p>



<a name="189903514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903514">(Mar 06 2020 at 15:27)</a>:</h4>
<p>one side note that is interesting</p>



<a name="189903522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903522">(Mar 06 2020 at 15:28)</a>:</h4>
<p>and relevant maybe to that</p>



<a name="189903572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903572">(Mar 06 2020 at 15:28)</a>:</h4>
<p>in chalk today, at least, the fold trait takes two interners -- source and target.</p>



<a name="189903578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903578">(Mar 06 2020 at 15:28)</a>:</h4>
<p>in practice, they are typically the same</p>



<a name="189903585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903585">(Mar 06 2020 at 15:28)</a>:</h4>
<p>but it lets you write code that separates out "before" and "after" types</p>



<a name="189903601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903601">(Mar 06 2020 at 15:28)</a>:</h4>
<p>one downside though is that it sometimes requires more re-interning than rustc would</p>



<a name="189903611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903611">(Mar 06 2020 at 15:28)</a>:</h4>
<p>i.e., we could shortcircuit a search</p>



<a name="189903656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903656">(Mar 06 2020 at 15:29)</a>:</h4>
<p>regarding interners: I wonder how many "parametric polymorphism"-like benefits you get from using associated types instead of having a single "interned Ty" type that's always an integer or reference</p>



<a name="189903677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903677">(Mar 06 2020 at 15:29)</a>:</h4>
<p>I sort of expect to resolve this eventually -- I'd prefer to keep the ability to write code generic over multiple interners to express logical separations, without requiring them to be represented by <em>actually different types</em>, and to add specializations or other tricks to make it efficient</p>



<a name="189903711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903711">(Mar 06 2020 at 15:30)</a>:</h4>
<p>but I figured that we'd start by just extracting "single Interner fold" (like rustc has today)</p>



<a name="189903783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903783">(Mar 06 2020 at 15:30)</a>:</h4>
<p>and figure out after that if we can generalize it, I'm not sure yet how much value the "two interner fold" has anyway</p>



<a name="189903803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903803">(Mar 06 2020 at 15:30)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189903656" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189903656">said</a>:</p>
<blockquote>
<p>regarding interners: I wonder how many "parametric polymorphism"-like benefits you get from using associated types instead of having a single "interned Ty" type that's always an integer or reference</p>
</blockquote>
<p>what do you mean by PP-like benefits?</p>



<a name="189903807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903807">(Mar 06 2020 at 15:30)</a>:</h4>
<p>for example, you can't even attempt to implement fmt::Debug on the generic structs by relying on TLS, without either Interner methods that let you do that, or the associated types themselves implementing fmt::Debug</p>



<a name="189903809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903809">(Mar 06 2020 at 15:30)</a>:</h4>
<p>I'm not sure if that's the same thing I was just talking about or different</p>



<a name="189903810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903810">(Mar 06 2020 at 15:30)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189903656" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189903656">said</a>:</p>
<blockquote>
<p>regarding interners: I wonder how many "parametric polymorphism"-like benefits you get from using associated types instead of having a single "interned Ty" type that's always an integer or reference</p>
</blockquote>
<p>Like theorems for free benefits?</p>



<a name="189903837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903837">(Mar 06 2020 at 15:31)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189903807" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189903807">said</a>:</p>
<blockquote>
<p>for example, you can't even attempt to implement fmt::Debug on the generic structs by relying on TLS, without either Interner methods that let you do that, or the associated types themselves implementing fmt::Debug</p>
</blockquote>
<p>yeah, we have some methods for customizing debug representation right now</p>



<a name="189903849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903849">(Mar 06 2020 at 15:31)</a>:</h4>
<p>like "you can't accidentally rely too much on knowing specifics about the types involved"</p>



<a name="189903864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903864">(Mar 06 2020 at 15:31)</a>:</h4>
<p>yes, ok</p>



<a name="189903871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903871">(Mar 06 2020 at 15:31)</a>:</h4>
<p>even if in practice there might only be one implementation in the entire crate graph</p>



<a name="189903882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903882">(Mar 06 2020 at 15:31)</a>:</h4>
<p>this is similar to what I was saying, I do think there's benefits there</p>



<a name="189903888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903888">(Mar 06 2020 at 15:31)</a>:</h4>
<p>Well... except for specialization destroying your parametricity...</p>



<a name="189903891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903891">(Mar 06 2020 at 15:31)</a>:</h4>
<p>or at least I think there might be</p>



<a name="189903953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903953">(Mar 06 2020 at 15:32)</a>:</h4>
<p>it's not like we use specialization in rustc <del>please ignore rustc_metadata</del></p>



<a name="189903974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189903974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189903974">(Mar 06 2020 at 15:32)</a>:</h4>
<p>specialization is not relevant here, we're talking more about informal benefits</p>



<a name="189904013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904013">(Mar 06 2020 at 15:32)</a>:</h4>
<p>right, not proof assistant benefits (you would presumably not worry about interners there :P)</p>



<a name="189904018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904018">(Mar 06 2020 at 15:32)</a>:</h4>
<p>but yeah if you want a theorem, add a "given no specialization" and call it a day :)</p>



<a name="189904024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904024">(Mar 06 2020 at 15:32)</a>:</h4>
<p>Sure; "theorems for free"-ish by not actually using specialization; anyways... it's probably not a big deal either way</p>



<a name="189904056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904056">(Mar 06 2020 at 15:33)</a>:</h4>
<p>ok, so, we're 13 minutes in, it seems like people are not too upset about the basic idea :)</p>



<a name="189904076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904076">(Mar 06 2020 at 15:33)</a>:</h4>
<p>Basic idea seems good</p>



<a name="189904090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904090">(Mar 06 2020 at 15:33)</a>:</h4>
<p>Details TBD, etc.</p>



<a name="189904148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904148">(Mar 06 2020 at 15:34)</a>:</h4>
<p>right, so let's talk a bit about the "transition plan" because I think it's relevant then</p>



<a name="189904161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904161">(Mar 06 2020 at 15:34)</a>:</h4>
<p>anyway, that was a hunch, and it does seem interesting enough that I might try this pattern in one my side projects (if I ever get back to it), and play around with the names and APIs to see how nice I can get it (for myself)</p>



<a name="189904188"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904188" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904188">(Mar 06 2020 at 15:34)</a>:</h4>
<p>I think the most practical thing is to try and gradually extract this library out from rustc</p>



<a name="189904190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904190">(Mar 06 2020 at 15:34)</a>:</h4>
<p>one of the benefits of this is we can track performance</p>



<a name="189904208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904208">(Mar 06 2020 at 15:34)</a>:</h4>
<p>so e.g. if we try to make things generic and we wind up losing out on some benefits we got from flags or whatever, we'll notice</p>



<a name="189904233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904233">(Mar 06 2020 at 15:35)</a>:</h4>
<p>Seems tricky though to do this as a series of small PRs</p>



<a name="189904244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904244">(Mar 06 2020 at 15:35)</a>:</h4>
<p>Do you think it might make sense to extract it from chalk-ra first? Presumably, this can be done fast enough, and could inform rustc extraction</p>



<a name="189904318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904318">(Mar 06 2020 at 15:36)</a>:</h4>
<p>Cause it seems fairly invasive... but maybe we can do e.g. <code>ty.kind</code> -&gt; <code>ty.kind()</code> -&gt; <code>ty.kind(tcx)</code> as a 2-PR step thing</p>



<a name="189904324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904324">(Mar 06 2020 at 15:36)</a>:</h4>
<p>Ie, we first do <em>exploration</em> with ra/chalk, and then procede with rustc plan</p>



<a name="189904326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904326">(Mar 06 2020 at 15:36)</a>:</h4>
<p>problem is rustc has all of the necessary complexity, so it will ultimately impose itself onto the design</p>



<a name="189904336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904336">(Mar 06 2020 at 15:36)</a>:</h4>
<p><span class="user-mention silent" data-user-id="126931">centril</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189904233" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189904233">said</a>:</p>
<blockquote>
<p>Seems tricky though to do this as a series of small PRs</p>
</blockquote>
<p>well, I'm not sure how <em>smal</em> said PRs will be, but I think we have to do it step by step, presumably by trying first to "align" the "API" of <code>Ty&lt;'tcx&gt;</code>,</p>



<a name="189904373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904373">(Mar 06 2020 at 15:37)</a>:</h4>
<p><span class="user-mention silent" data-user-id="126931">centril</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189904318" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189904318">said</a>:</p>
<blockquote>
<p>Cause it seems fairly invasive... but maybe we can do e.g. <code>ty.kind</code> -&gt; <code>ty.kind()</code> -&gt; <code>ty.kind(tcx)</code> as a 2-PR step thing</p>
</blockquote>
<p>right, I think there are basically a set of <em>mechanical</em> (if not <em>small</em>) Prs of this nature</p>



<a name="189904385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904385">(Mar 06 2020 at 15:37)</a>:</h4>
<p>so there's two main parts from this I'm seeing:</p>
<ul>
<li>reshape <code>TyKind</code> to have a Chalk-like hierarchy (especially the "apply" part)</li>
<li>introduce abstraction over the interner</li>
</ul>



<a name="189904404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904404">(Mar 06 2020 at 15:37)</a>:</h4>
<p>as I wrote, I hope that we get to the point where <code>Ty&lt;'tcx&gt;</code> is basically an <em>alias</em> for <code>rustc_ty::Ty&lt;TyCtxt&lt;'tcx&gt;&gt;</code></p>



<a name="189904425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904425">(Mar 06 2020 at 15:37)</a>:</h4>
<p>and we can probably do them relatively independently (except for the fact that they would likely conflict, diff-wise)</p>



<a name="189904432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904432">(Mar 06 2020 at 15:37)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189904385" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189904385">said</a>:</p>
<blockquote>
<p>so there's two main parts from this I'm seeing:</p>
<ul>
<li>reshape <code>TyKind</code> to have a Chalk-like hierarchy (especially the "apply" part)</li>
<li>introduce abstraction over the interner</li>
</ul>
</blockquote>
<p>yeah, and the two are fairly independent</p>



<a name="189904518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904518">(Mar 06 2020 at 15:38)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> to circle back to your question, on the chalk + rust-analyzer side, I think those too will have to migrate some. I do think it makes sense to start merging chalk + rust-analyzer's type representation</p>



<a name="189904533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904533">(Mar 06 2020 at 15:38)</a>:</h4>
<p>if it helps, we already do something like that with <code>rustc_target</code>, even if the abstraction looks nothing like <code>Interner</code>-generic types</p>



<a name="189904556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904556">(Mar 06 2020 at 15:38)</a>:</h4>
<p>my proposed end-point for now was that we had a library (let's call it <code>rustc-ty</code>) that is in-tree but also published periodically to <a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a> with meaningful semver</p>



<a name="189904576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904576">(Mar 06 2020 at 15:39)</a>:</h4>
<p>so that chalk + rust-analyzer can rely on it without using sysroot</p>



<a name="189904609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904609">(Mar 06 2020 at 15:39)</a>:</h4>
<p>(and without using unstable attributes)</p>



<a name="189904631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904631">(Mar 06 2020 at 15:39)</a>:</h4>
<p>we <em>were</em> doing something similar with libsyntax, except that the semver was "every change is a breaking change", and I'd prefer to do better with this library</p>



<a name="189904638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904638">(Mar 06 2020 at 15:39)</a>:</h4>
<p>(I don't know if we still are)</p>



<a name="189904645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904645">(Mar 06 2020 at 15:39)</a>:</h4>
<p>that is, <code>rustc::ty::layout</code> reexports <code>rustc_layout::abi::*</code> but shadows generic-over-typesystem parts of it like <code>TyLayout</code> with a <code>type</code> alias limited to <code>rustc::ty::Ty</code></p>



<a name="189904695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904695">(Mar 06 2020 at 15:40)</a>:</h4>
<p>ah, interesting</p>



<a name="189904699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904699">(Mar 06 2020 at 15:40)</a>:</h4>
<p>I hadn't seen that pattern</p>



<a name="189904711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904711">(Mar 06 2020 at 15:40)</a>:</h4>
<p>or maybe I did and forgot :)</p>



<a name="189904729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904729">(Mar 06 2020 at 15:40)</a>:</h4>
<p>/me waits for someone to tell him that he reviewed it</p>



<a name="189904735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904735">(Mar 06 2020 at 15:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189904556" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189904556">said</a>:</p>
<blockquote>
<p>my proposed end-point for now was that we had a library (let's call it <code>rustc-ty</code>) that is in-tree but also published periodically to <a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a> with meaningful semver</p>
</blockquote>
<p>The name rustc_ty is already taken btw</p>



<a name="189904755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904755">(Mar 06 2020 at 15:40)</a>:</h4>
<p>that's fine :) I'm not wedded to the name.</p>



<a name="189904757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904757">(Mar 06 2020 at 15:40)</a>:</h4>
<p>it would make even more sense if the module was <code>rustc::ty::abi</code> but that's a rename that has been pending for years, welp</p>



<a name="189904759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904759">(Mar 06 2020 at 15:40)</a>:</h4>
<p>it will contain more than types anyway</p>



<a name="189904787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904787">(Mar 06 2020 at 15:41)</a>:</h4>
<p>rustc-term...rustc-ir...?</p>



<a name="189904802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904802">(Mar 06 2020 at 15:41)</a>:</h4>
<p><code>rustc-typesystem</code></p>



<a name="189904809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904809">(Mar 06 2020 at 15:41)</a>:</h4>
<p>"term" is PL jargon but kind of what we want...</p>



<a name="189904814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904814">(Mar 06 2020 at 15:41)</a>:</h4>
<p>let's just rename the existing rustc_ty to something else <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="189904838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904838">(Mar 06 2020 at 15:41)</a>:</h4>
<p>also ok:)</p>



<a name="189904846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904846">(Mar 06 2020 at 15:41)</a>:</h4>
<p>the <code>term</code> crate is a terminal library, that might get confusing :P</p>



<a name="189904847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904847">(Mar 06 2020 at 15:41)</a>:</h4>
<p>"term" would be fine if you want to move MIR into it too</p>



<a name="189904865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904865">(Mar 06 2020 at 15:42)</a>:</h4>
<p>I was actually hoping we could consider the typesystem a part of MIR</p>



<a name="189904910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904910">(Mar 06 2020 at 15:42)</a>:</h4>
<p>ok, time-check: 40 minutes</p>



<a name="189904914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904914">(Mar 06 2020 at 15:42)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189904609" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189904609">said</a>:</p>
<blockquote>
<p>(and without using unstable attributes)</p>
</blockquote>
<p>Why this? I think we should be able to take advantage of unstable features and dogfood them</p>



<a name="189904926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904926">(Mar 06 2020 at 15:42)</a>:</h4>
<p>but that's a different pie in the sky</p>



<a name="189904928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904928">(Mar 06 2020 at 15:42)</a>:</h4>
<p><span class="user-mention silent" data-user-id="126931">centril</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189904847" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189904847">said</a>:</p>
<blockquote>
<p>"term" would be fine if you want to move MIR into it too</p>
</blockquote>
<p>so, this is actually a good point</p>



<a name="189904948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904948">(Mar 06 2020 at 15:42)</a>:</h4>
<p>I did not expet to move MIR into this, <em>but</em></p>



<a name="189904952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904952">(Mar 06 2020 at 15:42)</a>:</h4>
<p>I expected MIr to depend on it</p>



<a name="189904961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904961">(Mar 06 2020 at 15:42)</a>:</h4>
<p>and <del>perhaps</del> use the same <code>I: Interner</code> scheme to be made independent</p>



<a name="189904968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904968">(Mar 06 2020 at 15:42)</a>:</h4>
<p>(this is more a "down the line" sort of thing)</p>



<a name="189904980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904980">(Mar 06 2020 at 15:42)</a>:</h4>
<p>make it <code>rustc-mir</code> and then rename all internal crates to <code>rustc_mir_something</code></p>



<a name="189904986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904986">(Mar 06 2020 at 15:43)</a>:</h4>
<blockquote>
<p>with meaningful semver</p>
</blockquote>
<p>But we should be explicit that the library is not considered perma-stable. Ie, we might abondon it in Rust 1.2019.0 and pursue something else.</p>



<a name="189904999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189904999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189904999">(Mar 06 2020 at 15:43)</a>:</h4>
<p>Yes, I think we would be saying this:</p>



<a name="189905035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905035">(Mar 06 2020 at 15:43)</a>:</h4>
<ul>
<li>we do not guarantee the library will exist</li>
<li>we may and sometimes will introduce new major versions frequently</li>
<li>but we will let you know when that happens and not bump major version gratuitously</li>
</ul>



<a name="189905039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905039">(Mar 06 2020 at 15:43)</a>:</h4>
<p><a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/struct.Const.html" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/struct.Const.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/struct.Const.html</a> is somewhat tied to MIR</p>



<a name="189905093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905093">(Mar 06 2020 at 15:44)</a>:</h4>
<p>Yeah, I am not sure the best way to sever the "const and MIR" connection,</p>



<a name="189905137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905137">(Mar 06 2020 at 15:44)</a>:</h4>
<p>chalk doesn't have consts yet :P but</p>



<a name="189905141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905141">(Mar 06 2020 at 15:44)</a>:</h4>
<p>why are constants tied to MIR?</p>



<a name="189905156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905156">(Mar 06 2020 at 15:44)</a>:</h4>
<p>eh, all the MIR is referred to by <code>DefId</code>s</p>



<a name="189905163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905163">(Mar 06 2020 at 15:44)</a>:</h4>
<p>right, this is what I hope</p>



<a name="189905166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905166">(Mar 06 2020 at 15:44)</a>:</h4>
<p>ah</p>



<a name="189905174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905174">(Mar 06 2020 at 15:45)</a>:</h4>
<p>I was just reviewing <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/enum.ConstKind.html" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/enum.ConstKind.html">ConstKind</a></p>



<a name="189905182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905182">(Mar 06 2020 at 15:45)</a>:</h4>
<p>so that seems fine</p>



<a name="189905194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905194">(Mar 06 2020 at 15:45)</a>:</h4>
<p>the chalk <code>Interner</code> trait, as it ahppens, also has a <code>I::DefId</code> associated type :)</p>



<a name="189905195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905195">(Mar 06 2020 at 15:45)</a>:</h4>
<p>does seem fine</p>



<a name="189905231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905231">(Mar 06 2020 at 15:45)</a>:</h4>
<p>though we've been debating about whether to make more of them (e.g., <code>StructDefId</code> and the lke)</p>



<a name="189905238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905238">(Mar 06 2020 at 15:45)</a>:</h4>
<p>but that's a separate thing</p>



<a name="189905241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905241">(Mar 06 2020 at 15:45)</a>:</h4>
<p>we do have the <code>Promoted</code> index, but I think that's surmountable</p>



<a name="189905312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905312">(Mar 06 2020 at 15:46)</a>:</h4>
<blockquote>
<p>but we will let you know when that happens and not bump major version gratuitously</p>
</blockquote>
<p>I'm not a fan of providing any sort of stability / conservatism wrt. rustc internals; we should be able to change things as needed, although I don't expect that we will frequently break <code>Ty</code> internals (the query database we absolutely do however)</p>



<a name="189905327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905327">(Mar 06 2020 at 15:46)</a>:</h4>
<p>right either it becomes an associated type, or we just include the indices, I think that's the kind of thing we can tinker with to try and find the right place to draw the lines</p>



<a name="189905374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905374">(Mar 06 2020 at 15:47)</a>:</h4>
<p>Similarly I think we should be able to use unstable features in this new library, and e.g. rustc_typeck if/when we start migrating that</p>



<a name="189905402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905402">(Mar 06 2020 at 15:47)</a>:</h4>
<p><span class="user-mention silent" data-user-id="126931">centril</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189905312" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189905312">said</a>:</p>
<blockquote>
<blockquote>
<p>but we will let you know when that happens and not bump major version gratuitously</p>
</blockquote>
<p>I'm not a fan of providing any sort of stability / conservatism wrt. rustc internals; we should be able to change things as needed, although I don't expect that we will frequently break <code>Ty</code> internals (the query database we absolutely do however)</p>
</blockquote>
<p>This is probably worth talking about a bit more. I want rustc to be able to be divided up into more independent libraries that people can focus on. Having meaningful boundaries is an important part of that. It doesn't mean we can't change things, but at least <em>knowing</em> when we did so will be helpful.</p>



<a name="189905403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905403">(Mar 06 2020 at 15:47)</a>:</h4>
<p>I think we can have an abstract type/trait system and even MIR bodies that hide a lot of the gnarly details behind associated types / methods</p>



<a name="189905511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905511">(Mar 06 2020 at 15:48)</a>:</h4>
<p>I would actually go further and say that if we are able to find meaningful and correct boundaries,</p>



<a name="189905520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905520">(Mar 06 2020 at 15:48)</a>:</h4>
<p>it won't be much work to maintain them</p>



<a name="189905539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905539">(Mar 06 2020 at 15:48)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189905402" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189905402">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="126931">centril</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189905312" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189905312">said</a>:</p>
<blockquote>
<blockquote>
<p>but we will let you know when that happens and not bump major version gratuitously</p>
</blockquote>
<p>I'm not a fan of providing any sort of stability / conservatism wrt. rustc internals; we should be able to change things as needed, although I don't expect that we will frequently break <code>Ty</code> internals (the query database we absolutely do however)</p>
</blockquote>
<p>This is probably worth talking about a bit more. I want rustc to be able to be divided up into more independent libraries that people can focus on. Having meaningful boundaries is an important part of that. It doesn't mean we can't change things, but at least <em>knowing</em> when we did so will be helpful.</p>
</blockquote>
<p>Sure, but typically we know via PRs that we changed things?</p>



<a name="189905590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905590">(Mar 06 2020 at 15:49)</a>:</h4>
<p>Longer term, I'd like to be able to support people building more complex tooling for analyzing rust (think Libra's MIRAI) as well, eventually, and have them be able to use our libraries (think Roslyn)</p>



<a name="189905601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905601">(Mar 06 2020 at 15:49)</a>:</h4>
<p>Existence of such meaningful boundaries is an open question though :D But it makes sense to at least try</p>



<a name="189905621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905621">(Mar 06 2020 at 15:49)</a>:</h4>
<p>Starting to maintain CHANGELOG.md and stuff feels like a hassle</p>



<a name="189905647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905647">(Mar 06 2020 at 15:49)</a>:</h4>
<p>like MIR is relatively simple if you hide all of the builtins as pure-ish operations of various arities</p>



<a name="189905727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905727">(Mar 06 2020 at 15:50)</a>:</h4>
<p>I would want to put a line of "no unstable features"</p>



<a name="189905731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905731">(Mar 06 2020 at 15:50)</a>:</h4>
<p>in rustc-ty</p>



<a name="189905757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905757">(Mar 06 2020 at 15:50)</a>:</h4>
<p>basically, I think there's still some ongoing debate about the best "shape"</p>



<a name="189905774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905774">(Mar 06 2020 at 15:50)</a>:</h4>
<p>and I want this library to not take a side :)</p>



<a name="189905824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905824">(Mar 06 2020 at 15:51)</a>:</h4>
<p>i.e., should rustc dev be something where people can drop in with a stable compiler and participate in much the same way as any other project?</p>



<a name="189905825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905825">(Mar 06 2020 at 15:51)</a>:</h4>
<p>I disagree with such a line; It's not something we do in the compiler, and if we start here it will definitely spread to other crates that depend on <code>rustc_ty</code></p>



<a name="189905863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905863">(Mar 06 2020 at 15:51)</a>:</h4>
<p>It will spread to any crate that is going to be consumed by rust-analyzer and chalk :)</p>



<a name="189905940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905940">(Mar 06 2020 at 15:52)</a>:</h4>
<p>Until we decide firmly one way or the other, which I (personally) feel is too soon to do</p>



<a name="189905942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905942">(Mar 06 2020 at 15:52)</a>:</h4>
<p>And presumably that number will increase, as rust-analyzer shares more and more code, disallowing us from testing unstable features in the compiler</p>



<a name="189905973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905973">(Mar 06 2020 at 15:52)</a>:</h4>
<p>we could do some auditing and see which unstable features we care about (e.g. <code>extern type</code> is useful in making <code>ty::List</code> work) and which not so much</p>



<a name="189905978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905978">(Mar 06 2020 at 15:52)</a>:</h4>
<p>Unless we decide to require nightly, that's true.</p>



<a name="189905986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905986">(Mar 06 2020 at 15:52)</a>:</h4>
<p>But we can revisit this topic once we have more experience.</p>



<a name="189905999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189905999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189905999">(Mar 06 2020 at 15:52)</a>:</h4>
<p>Personally I think that's a good trade, but I have felt differently in the past</p>



<a name="189906038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906038">(Mar 06 2020 at 15:53)</a>:</h4>
<p>(i.e., I think that dogfooding unstable features on rustc was super useful to rust during its development -- I'm less sure now, but I see the point)</p>



<a name="189906063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906063">(Mar 06 2020 at 15:53)</a>:</h4>
<p>but yeah what I hoped for in this meeting was that we could just not decide yet :)</p>



<a name="189906125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906125">(Mar 06 2020 at 15:54)</a>:</h4>
<p>I'm fine with sticking with the status quo of not changing things in terms of unstable features</p>



<a name="189906128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906128">(Mar 06 2020 at 15:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189905973" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189905973">said</a>:</p>
<blockquote>
<p>we could do some auditing and see which unstable features we care about (e.g. <code>extern type</code> is useful in making <code>ty::List</code> work) and which not so much</p>
</blockquote>
<p>yes, I'd be interested if there are unstable features we really need, though right now that stuff is abstracted through the <code>Interner</code> trait</p>



<a name="189906129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906129">(Mar 06 2020 at 15:54)</a>:</h4>
<p>anyway before I lose this from my clipboard:</p>
<p>this typesystem vs/besides MIR reminds me I thought of <del>abusing</del> reusing the new mangling scheme as a def-path/type serialization system (e.g. between two users of rustc-ty/rustc-mir/whatever we're calling it), because it's already compact, has builtin compression, and it can handle some typesystem corner cases better than plain Rust syntax</p>



<a name="189906136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906136">(Mar 06 2020 at 15:54)</a>:</h4>
<p>and discussing a change later</p>



<a name="189906145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906145">(Mar 06 2020 at 15:54)</a>:</h4>
<p>(time-check: 54 minutes, so we're basically done)</p>



<a name="189906186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906186">(Mar 06 2020 at 15:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189906129" title="#narrow/stream/131828-t-compiler/topic/design.20meeting.202020-03-06/near/189906129">said</a>:</p>
<blockquote>
<p>anyway before I lose this from my clipboard:</p>
</blockquote>
<p>I'm intrigued but not sure I'm fully following :)</p>



<a name="189906199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906199">(Mar 06 2020 at 15:55)</a>:</h4>
<p>As for dogfooding, I think it's still very useful, both because it lets us real-world-test the benefits of a feature, but more importantly, it allows us to find bugs in a feature, since fewer people tend to use nightly these days</p>



<a name="189906248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906248">(Mar 06 2020 at 15:55)</a>:</h4>
<p>it came up while I was discussing Ferrous Systems' "sealed Rust" with <span class="user-mention" data-user-id="228912">@James Munns</span></p>



<a name="189906322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906322">(Mar 06 2020 at 15:56)</a>:</h4>
<p>("really need" is highly subjective; e.g. a bunch of ergonomics features would presumably answer that with "no", but it's still important to test those out, and they make development nicer.)</p>



<a name="189906337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906337">(Mar 06 2020 at 15:56)</a>:</h4>
<p>long-term they would like if the frontend and backend could be split with a (presumably human-inspectable) IR in the middle</p>



<a name="189906358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906358">(Mar 06 2020 at 15:56)</a>:</h4>
<p>It is my impression that </p>
<ul>
<li>folks in this meeting are "cautiously optimistic" about this approach, and open to us trying to create PRs that move rustc in this direction</li>
<li>ok with having a rusc-ty library that is published to <a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a></li>
<li>there remains disagreement about the big picture question of how stable API boundaries can/should be between libraries, whether they should live in their own repos, and whether they should use unstable  features (but that was not the direct topic of this meeting, so that's ok)</li>
</ul>



<a name="189906380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906380">(Mar 06 2020 at 15:57)</a>:</h4>
<p>does that sound correct?</p>



<a name="189906394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906394">(Mar 06 2020 at 15:57)</a>:</h4>
<p>so it overlaps with "MIR abstracted out of rustc" ideas that adjacent to what we're talking about here</p>



<a name="189906436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906436">(Mar 06 2020 at 15:57)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I might want to bikeshed the name but other than that yeah :P</p>



<a name="189906441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/189906441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#189906441">(Mar 06 2020 at 15:57)</a>:</h4>
<p>Yep; <span class="user-mention" data-user-id="116009">@nikomatsakis</span>  you might perhaps want to include this:</p>
<blockquote>
<p>So, a sketch for a plan in <code>rustc</code> (each step is a PR):<br>
1. <code>ty.kind</code> -&gt; <code>ty.kind()</code><br>
2. <code>ty.kind()</code>-&gt; <code>ty.kind(tcx)</code><br>
3. Add a type alias and make <code>kind</code> work on <code>I: Interner</code><br>
4. Start using <code>Ty&lt;I&gt;</code> more (This is a lot of PRs)</p>
</blockquote>



<a name="190379378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/design%20meeting%202020-03-06/near/190379378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/design.20meeting.202020-03-06.html#190379378">(Mar 12 2020 at 11:35)</a>:</h4>
<p>posted minutes from this meeting in <a href="https://github.com/rust-lang/compiler-team/issues/255" target="_blank" title="https://github.com/rust-lang/compiler-team/issues/255">compiler-team#255</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>